package com.itheima.tlias.mapper;

import com.itheima.tlias.mapper.sql.EmpMapperSqlProvider;
import com.itheima.tlias.model.dto.EmpQueryDTO;
import com.itheima.tlias.model.entity.Emp;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.SelectProvider;

import java.util.List;

/**
 * @author Lee
 * @created 2024/4/8
 * @describtion
 */
@Mapper
public interface EmpMapper {
    /**
     * 根据条件统计满足条件总记录
     *
     * @param dto 条件
     * @return Long
     */
    @SelectProvider(type = EmpMapperSqlProvider.class, method = "selectCount")
    Long selectCount(EmpQueryDTO dto);

    /**
     * 分页条件查询 员工信息
     *
     * @param dto 条件
     * @return List<Emp>
     */
    @SelectProvider(type = EmpMapperSqlProvider.class, method = "selectByPage")
    List<Emp> selectByPage(EmpQueryDTO dto);
}
